#pragma once
#include <iostream>

#define C_SHARP_MAX_OBJECTS 1000

struct bbox_t {
	int		 id = -1;
	float	 prob = 0.f;
	unsigned int x, y, w, h;       // (x,y) - top-left corner, (w, h) - width & height of bounded box
};

struct image_t {
	int h = 0;									// height
	int w = 0;									// width
	int c = 0;									// number of chanels (3 - for RGB)

	float			**rgbf = 0;                 // pointer to the image data   n * r + n*g + n*b
	unsigned char	**rgb8 = 0;					// pointer to the image data   n * r + n*g + n*b
	unsigned short	**rgb16 = 0;				// pointer to the image data   n * r + n*g + n*b

	float			**dev_rgbf = 0;				// gpu data r + g + b
	unsigned char	**dev_rgb8 = 0;				// gpu data r + g + b
	unsigned short	**dev_rgb16= 0;				// gpu data r + g + b
};

struct bbox_t_container {
	bbox_t candidates[C_SHARP_MAX_OBJECTS];
};


struct st_dlm_data
{
	image_t			img;

	float			prob_threshold = 0.3f;
	float			nms_threshold = 0.5f;

	bbox_t			result_boxs[C_SHARP_MAX_OBJECTS];
	int				result_box_num = 0;
};


//==========================================================================================
enum PRECISION_MODE
{
	PRECISION_FP32,
	PRECISION_FP16,
	PRECISION_INT8,
};



struct st_trans_model_input 
{
	std::string cfg_path;
	std::string model_path;

	PRECISION_MODE precison = PRECISION_FP16;
	std::string gpu_model = "NVIDIA GeForce RTX 3060";

	std::string trans_path;
};

const static int MAX_STRIDES = 3;
struct st_encrypt_info
{
	char gpu_model[100];

	int batch_size;
	int class_num;
	int input_channel;
	int image_width;
	int image_height;

	int stride_num;
	int strides[MAX_STRIDES];
	int grid[MAX_STRIDES][2];

	int engine_size = 0;
	st_encrypt_info()
	{
		memset(this, 0, sizeof(st_encrypt_info));
	}
};

